package com.geek.water.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @author yangwenqi
 * @decs TODO
 * @date 2025/7/24
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("user")
@ApiModel(description = "用户登录账号表")
public class User implements Serializable {
    @ApiModelProperty("主键，自增用户ID")
    @TableId(type = IdType.AUTO)
    private Long id;

    @ApiModelProperty("关联客户ID")
    @TableField("customer_id")
    private Long customerId;

    @ApiModelProperty("登录用户名")
    @TableField("username")
    private String username;

    @ApiModelProperty("密码")
    @TableField("password")
    private String password;

    @ApiModelProperty("头像")
    @TableField("avatar")
    private String avatar;

    @ApiModelProperty("手机号码")
    @TableField("mobile")
    private String mobile;

    @ApiModelProperty("电子邮箱")
    @TableField("email")
    private String email;

    @ApiModelProperty("用户状态：enabled-启用，disabled-禁用")
    @TableField("status")
    private String status;

    @ApiModelProperty("最后登录时间")
    @TableField("last_login_time")
    private LocalDateTime lastLoginTime;

    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty("创建时间")
    private LocalDateTime createdAt;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    @ApiModelProperty("更新时间")
    private LocalDateTime updatedAt;

    @ApiModelProperty("角色列表")
    @TableField(exist = false)
    private List<Role> roles;

    @ApiModelProperty("客户名称")
    @TableField(exist = false)
    private String customerName;


    @ApiModelProperty("性别：male-男，female-女")
    @TableField("gender")
    private String gender;
}
